﻿using System;

namespace Domain.Setup.Entities
{
    /// <summary>
    /// Defines the amount of time taken to travel from one location to another.
    /// </summary>
    public class TransitTime : ICloneable
    {
        /// <summary>
        /// Gets or sets the location that will be travelled to.
        /// </summary>
        /// <value>
        /// To location.
        /// </value>
        public Location ToLocation { get; set; }

        /// <summary>
        /// Gets or sets the travel time to the associated location.
        /// </summary>
        /// <value>
        /// The travel time.
        /// </value>
        public TimeSpan TravelTime { get; set; }

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
            return new TransitTime
            {
                ToLocation = (Location)this.ToLocation.Clone(),
                TravelTime = this.TravelTime
            };
        }
    }
}
